From: Camila Ayres Date: Tue, 10 Dec 2024 16:40:08 +0000 (+0100) Subject: Include Nextcloud in the search for legacy config when the client is branded. X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~30^2^2~196^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=04a16a5946c58cadcadfe2e92f718610361e970f;p=nextcloud-desktop.git Include Nextcloud in the search for legacy config when the client is branded. Signed-off-by: Camila Ayres --- diff --git a/src/gui/accountmanager.cpp b/src/gui/accountmanager.cpp index 6619e70fe..a661f3eb3 100644 --- a/src/gui/accountmanager.cpp +++ b/src/gui/accountmanager.cpp @@ -73,6 +73,9 @@ constexpr auto networkProxyPasswordKeychainKeySuffixC = "_proxy_password"; constexpr auto legacyRelativeConfigLocationC = "/ownCloud/owncloud.cfg"; constexpr auto legacyCfgFileNameC = "owncloud.cfg"; +constexpr auto unbrandedRelativeConfigLocationC = "/Nextcloud/nextcloud.cfg"; +constexpr auto unbrandedCfgFileNameC = "nextcloud.cfg"; + // The maximum versions that this client can read constexpr auto maxAccountsVersion = 2; constexpr auto maxAccountVersion = 1; @@ -192,10 +195,16 @@ bool AccountManager::restoreFromLegacySettings() const auto legacyCfgFileNamePath = QString(QStringLiteral("/") + legacyCfgFileNameC); const auto legacyCfgFileRelativePath = QString(legacyRelativeConfigLocationC); - const auto legacyLocations = QVector{legacy2_4CfgFileParentFolder + legacyCfgFileRelativePath, - legacy2_5CfgFileParentFolder + legacyCfgFileRelativePath, - legacyCfgFileParentFolder + legacyCfgFileNamePath, - legacyCfgFileGrandParentFolder + legacyCfgFileRelativePath}; + auto legacyLocations = QVector{legacy2_4CfgFileParentFolder + legacyCfgFileRelativePath, + legacy2_5CfgFileParentFolder + legacyCfgFileRelativePath, + legacyCfgFileParentFolder + legacyCfgFileNamePath, + legacyCfgFileGrandParentFolder + legacyCfgFileRelativePath}; + + if (Theme::instance()->isBranded()) { + const auto unbrandedCfgFileNamePath = QString(QStringLiteral("/") + unbrandedCfgFileNameC); + const auto unbrandedCfgFileRelativePath = QString(unbrandedRelativeConfigLocationC); + legacyLocations.append({legacyCfgFileParentFolder + unbrandedCfgFileNamePath, legacyCfgFileGrandParentFolder + unbrandedCfgFileRelativePath}); + } for (const auto &configFile : legacyLocations) { auto oCSettings = std::make_unique(configFile, QSettings::IniFormat);